[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INKEY()

    INKEY() reads a character from the keyboard.

Syntax

    INKEY([<expN>])

Argument

    <expN> specifies the number of seconds INKEY() waits for a key press.
    Specifying zero halts the program until a key is pressed.  Note that
    the time INKEY() waits is based on the operating system clock and
    therefore is not related to the microprocessor speed.

Returns

    An integer numeric value.

    INKEY() returns a number from -39 to 386, identifying the ASCII code of
    the key pressed (the same value as returned by LASTKEY()).  If the
    keyboard buffer is empty, INKEY() returns zero.

    INKEY() returns values for all function, Alt-function, Ctrl-function,
    Alt-letter, and Ctrl-letter key combinations.

Usage

    INKEY() is useful for polling the keyboard or pausing program
    execution.  As an instance, you can use INKEY() to terminate commands
    with a record scope such as LIST, LABEL FORM, and REPORT FORM by
    including it in a while condition as follows:

    REPORT FORM Report WHILE INKEY() <> 27

    To make your key operations easier to maintain, create a series of
    keyname memory variables using CHR().  Later in your program, you can
    compare the result of INKEY() to the keyname variable using the
    expression, CHR(INKEY()).

See Also: SET KEY CHR LASTKEY()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson